package com.chen.dao.provider;

import java.sql.SQLException;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.chen.pojo.Provider;
@Mapper
public interface ProviderDao {
	
	/**
	 * 澧炲姞涓�鏉′緵搴斿晢淇℃伅
	 * @param connection
	 * @param provider
	 * @return
	 * @throws Exception
	 */
	public int add(Provider provider)throws Exception;


	/**
	 * 鏍规嵁渚涘簲鍟嗗悕瀛楀拰渚涘簲鍟嗙紪鐮佹煡璇俊鎭�
	 * @param connection
	 * @param proName
	 * @return
	 * @throws Exception
	 */
	public List<Provider> getProviderList(@Param("proName") String proName,@Param("proCode") String proCode,@Param("form") int currentPageNo,@Param("pageSize") int pageSize)throws Exception;
	
	/**
	 * 鍒犻櫎涓�鏉′緵搴斿晢淇℃伅
	 * @param delId
	 * @return
	 * @throws Exception
	 */
	public int deleteProviderById(String delId)throws Exception; 
	
	
	/**
	 * 鏍规嵁id鏌ユ壘涓�鏉′俊鎭�
	 * @param connection
	 * @param id
	 * @return
	 * @throws Exception
	 */
	public Provider getProviderById(String id)throws Exception; 
	
	/**
	 * 淇敼涓�鏉′緵搴斿晢淇℃伅
	 * @param connection
	 * @param user
	 * @return
	 * @throws Exception
	 */
	public int modify(Provider provider)throws Exception;
	/**
	 * 鏌ユ壘鎬昏褰曟暟
	 * @param connection
	 * @param proName
	 * @param proCode
	 * @return
	 * @throws Exception 
	 */
	public int getProviderCount(@Param("proName") String proName,@Param("proCode") String proCode) throws Exception;
	/**
	 * 查询所有
	 * @return
	 * @throws SQLException
	 */
	public List<Provider> queryList() throws SQLException;
}
